import java.util.HashSet;

public class ATestHashSet
{
    public static void main(String[] args)
    {
        HashSet set0 = new HashSet();
        HashSet<Integer> set1 = new HashSet<>();
        set0.add("nbnb666");
        set0.add("nihaoniuwa");
        System.out.println(set0);
        System.out.println(set0.toString());
        System.out.println(set1.contains("你有有吗？"));
        set0.clear();
        System.out.println(set0);
        System.out.println(set0.toString());
        System.out.println(set0.isEmpty());
//        System.out.println(set0.add("neng","duo","jia","ma?"));//显然add每次只能添加一个元素！
        set0.add(1);
        set0.add(2);
        set0.add("未定类型的集合，重新清空之后加个字符串变量鱼目混珠？");
        set0.add(3);
         System.out.println(set0.toString());
         set1.add(10246666);
//         set1.add("这个整形的哈希结合加不了字符串！");
         set1.add(1024996);
         set0.addAll(set1);
        System.out.println(set0);
        System.out.println(set0.iterator());
        Object [] arr=set0.toArray();
        for(int i=0;i<arr.length;i++)
        {
            System.out.println(arr[i]);
        }
        System.out.println(set0);
        set0.remove(10246666);
        System.out.println(set0);

        System.out.println(set0.spliterator());

    }
}
